package com.punai.Incomedata.controller;

import com.punai.Incomedata.service.SrStatisticsService;
import com.punai.Incomedata.vo.SrStatisticsVo;
import com.punai.common.core.controller.BaseController;
import com.punai.common.core.domain.AjaxResult;
import com.punai.common.core.page.TableDataInfo;
import com.punai.externalccb.domain.EcoZbstructitem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * 收入指标
 */
@RestController
@RequestMapping("/incomedata/srStatistics")
public class SrStatisticsController extends BaseController {
    @Autowired
    private SrStatisticsService srStatisticsService;

    @PreAuthorize("@ss.hasPermi('prolib.income.srStatistics.getItemTabNames')")
    @PostMapping("/getItemTabNames")
    public AjaxResult getItemTabNames(@RequestBody EcoZbstructitem zbstructitem) {
        return AjaxResult.success(srStatisticsService.getItemTabNames(zbstructitem));
    }

    @PreAuthorize("@ss.hasPermi('prolib.income.srStatistics.list')")
    @PostMapping("/listSrZBTable")
    public TableDataInfo listSrZBTable(@RequestBody SrStatisticsVo vo) {
        return getDataTable(srStatisticsService.listSrZBTable(vo));
    }
}
